<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>用户个人详情页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .profile-container {
            width: 100%;
            max-width: 400px;
            background: white;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        .profile-header {
            margin-bottom: 20px;
        }

        .profile-header h1 {
            margin: 0;
        }

        .avatar {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            overflow: hidden;
            margin: auto;
            margin-bottom: 20px;
        }

        .avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-info {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .info-group {
            width: 100%;
            margin-bottom: 20px;
            text-align: left;
        }

        .info-group label {
            display: block;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .info-group p {
            margin: 0;
            padding: 8px;
            background-color: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 4px;
            width: calc(100% - 16px); /* Adjust for padding */
        }

        button {
            background-color: #007bff;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            display: block;
            margin: 20px auto;
        }

        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>

<div class="profile-container">
    <form method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="username">用户名</label>
            {{ form.name }}
            {% if form.username.errors %}
                <div class="invalid-feedback">
                    {{ form.username.errors }}
                </div>
            {% endif %}
        </div>

        <div class="form-group">
            <label for="old_password">原密码</label>
            {{ form.old_password }}
            {% if form.old_password.errors %}
                <div class="invalid-feedback">
                    {{ form.old_password.errors }}
                </div>
            {% endif %}
        </div>

        <div class="form-group">
            <label for="password">新密码</label>
            {{ form.password }}
            {% if form.password.errors %}
                <div class="invalid-feedback">
                    {{ form.password.errors }}
                </div>
            {% endif %}
        </div>

        <div class="form-group">
            <label for="password2">确认密码</label>
            {{ form.password2 }}
            {% if form.password2.errors %}
                <div class="invalid-feedback">
                    {{ form.password2.errors }}
                </div>
            {% endif %}
        </div>

        {#        <div class="form-group">#}
        {#            <label for="username">用户名:{{ form.name }}</label>#}
        {#            {{ form.username.errors }}#}
        {#            <label for="name">原密码:{{ form.old_password }}</label>#}
        {##}
        {#            <label for="password">新密码:{{ form.password }}</label>#}
        {#            {{ form.password.errors }}#}
        {#            <label for="password">确认密码:{{ form.password2 }}</label>#}
        {#            {{ form.password2.errors }}#}
        {##}
        {#        </div>#}
        <button type="submit" class="btn btn-default">提交</button>
    </form>
</div>


</body>
</html>